//
//  CascadeData.h
//  etionUI
//
//  Created by wangjian on 11/21/13.
//  Copyright (c) 2013 GuangZhouXuanWu. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef enum {ECascadeSelectorOperateTypeSingleSel, ECascadeSelectorOperateTypeMultiSel} ECascadeSelectorOperateType;
typedef enum {ECascadeSelectorCellDataTypeSet, ECascadeSelectorCellDataTypeSingleSelector, ECascadeSelectorCellDataTypeMultiSelector} ECascadeSelectorCellDataType;

@interface CCascadeSelectorCellData : NSObject

@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *szId;
@property (nonatomic, copy) NSString *parentId;
@property (nonatomic, assign) CCascadeSelectorCellData *parent;
@property (nonatomic, retain) NSMutableArray *children;
@property (nonatomic, assign) ECascadeSelectorCellDataType type;
@property (nonatomic, assign) BOOL selected;

- (BOOL)enumerateDataUsingBlock:(void (^)(CCascadeSelectorCellData *data, BOOL *stop))block;

@end

@interface CCascadeData : NSObject

@property (nonatomic, assign) CCascadeSelectorCellData *rootData;
@property (nonatomic, assign) ECascadeSelectorOperateType operateType;

// This property valid when "operateType" is ECascadeSelectorOperateTypeSingleSel
@property (nonatomic, readonly) CCascadeSelectorCellData *curSelectedCellData;

- (void)enumerateObjectsUsingBlock:(void (^)(CCascadeSelectorCellData *data, NSUInteger level, NSUInteger index, BOOL *stop))block;

@end
